<!-- 本示例未包含完整css，获取外链css请参考上文，在hello uni-app项目中查看 -->
<template>
	<view>
		<view class="con_box">
			<view style="width: 100px;">选择门店</view>
			<view class="uni-input" @click="show = true">
				<span style="margin-right: 10px;">{{store}}</span>
				<u-icon name="arrow-right" color="#999999" size="28"></u-icon>
			</view>
		</view>
		<u-select v-model="show" :list="list" value-name="id" label-name="shop_name" @confirm="confirm"></u-select>
		<!-- <view class="con_box">
			<view style="width: 100px;">报表类型</view>
			<picker @change="bindPickerChange" :value="index" :range="array1">
				<view class="uni-input"><span style="margin-right: 10px;">{{array1[index]}}</span>
					<u-icon name="arrow-right" color="#999999" size="28"></u-icon>
				</view>
			</picker>
		</view> -->
		<!-- <view class="con_box">
			<view style="width: 100px;">开始时间</view>
			<view class="uni-input" @click="showstartTime = true">
				<span style="margin-right: 10px;">{{starTime}}</span>
				<u-icon name="arrow-right" color="#999999" size="28"></u-icon>
			</view>
		</view> -->
		<!-- <view class="con_box">
			<view style="width: 100px;">结束时间</view>
			<view class="uni-input" @click="showendTime = true">
				<span style="margin-right: 10px;">{{endTime}}</span>
				<u-icon name="arrow-right" color="#999999" size="28"></u-icon>
			</view>
		</view> -->
		
		<!-- 时间选择 -->
		<u-calendar v-model="showstartTime" mode="date" max-date="2100-1-1"  @change="startIimechange"></u-calendar>
		<u-calendar v-model="showendTime" mode="date"  max-date="2100-1-1" @change="endIimechange"></u-calendar>
		
		<view class="button">
			<u-button type="error" shape="circle" @click="sure()">确定</u-button>
		</view>


		<!-- <view class="uni-title uni-common-pl">选择门店</view>
		<view class="uni-list">
			<view class="uni-list-cell">
				<view class="uni-list-cell-db">
					<picker @change="bindPickerChange" :value="index" :range="array">
						<view class="uni-input">{{array[index]}}</view>
					</picker>
				</view>
			</view>
		</view> -->

		<!-- 	<view class="uni-title uni-common-pl">报表类型</view>
		<view class="uni-list">
			<view class="uni-list-cell">
				<view class="uni-list-cell-db">
					<picker @change="bindPickerChange" :value="index" :range="array">
						<view class="uni-input">{{array1[index]}}</view>
					</picker>
				</view>
			</view>
		</view> -->

		<!-- <view class="uni-title uni-common-pl">开始时间</view>
		<view class="uni-list">
			<view class="uni-list-cell">
				<view class="uni-list-cell-db">
					<picker mode="time" :value="time" start="09:01" end="21:01" @change="bindTimeChange">
						<view class="uni-input"><u-icon name="arrow-right" color="#999999" size="28"></u-icon></view>
					</picker>
				</view>
			</view>
		</view> -->

		<!-- 	<view class="uni-title uni-common-pl">结束时间</view>
		<view class="uni-list">
			<view class="uni-list-cell">
				<view class="uni-list-cell-db">
					<picker mode="date" :value="date" :start="startDate" :end="endDate" @change="bindDateChange">
						<view class="uni-input"><u-icon name="arrow-right" color="#999999" size="28"></u-icon></view>
					</picker>
				</view>
			</view>
		</view> -->
	</view>
</template>
<script>
	export default {
		data() {
			return {
				show:false,
				id:'',
				store:"请选择门店",
				list: [],
				index: 0,
				showstartTime:false,
				showendTime:false,
				starTime:'请选择开始时间',
				endTime:'请选择结束时间',
			}
		},
		computed: {
		},
		onShow() {
			this.getStoreAddress();
		},
		methods: {
			// 获取门店列表
			getStoreAddress() {
				this.$http_business('store.listNoPage', ).then(res => {
					if (res.code == 1) {
						this.list = res.data
					}
				});
			},
			confirm(e){
				var that = this;
				that.store = e[0].label;
				that.id = e[0].value;
			},
			// 开始时间
			startIimechange(e){
				console.log(e);
				this.starTime = e.result;
			},
			// 结束时间
			endIimechange(e){
				console.log(e);
				this.endTime = e.result
			},
			sure(){
				if (!this.id) {
					this.$u.toast('请选择门店  ');
					return;
				}
				uni.reLaunch({
					url: 'pages/index/index?id='+ this.id
				});
			}
		}
	}
</script>
<style lang="scss" scoped>
	.con_box {
		width: 100%;
		height: 112rpx;
		background: #FFFFFF;
		border-bottom: 1px solid #E7E7E7;
		;
		padding: 40rpx;
		display: flex;
		justify-content: space-between;
		align-items: center;
	}

	.uni-input {
		font-size: 28rpx;
		font-family: PingFangSC-Regular, PingFang SC;
		font-weight: 400;
		color: #999999;
	}

	.button {
		position: fixed;
		width: 100%;
		bottom: 0;
		left: 0;
		padding: 30rpx;
	}
</style>
